﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using BaseEntities;

namespace DataAccess
{
    public class CardDAO
    {
        private static SqlConnection cn = null;
        public bool CheckCardNo(string CardNo)
        {

            cn = DBConnect.GetConnection();
            cn.Open();
            SqlCommand cmd = new SqlCommand("sp_ValidCard ", cn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@CardNo", SqlDbType.VarChar).Value = CardNo;
            SqlDataReader reader = cmd.ExecuteReader();
            if (reader.HasRows)
            {
                cn.Close();
                return true;
            }
            else

                return false;
        }
    }
}
